/**
 * 单选组
 */
export default class VuiRadioGroup {
  constructor(id) {
    this.id = id;
    this.items = [];
  }

  static newInstance(id) {
    return new VuiRadioGroup(id);
  }

  addItem(item) {
    this.items.push(item);
  }

  /**
   * 清理兄弟节点
   * @param {*} curItem
   */
  cleanBrother(curItem) {
    const items = this.items;
    items.forEach(item => {
      if (curItem !== item) {
        item.setChecked(false);
      }
    });
  }
}
